<template>
	<yd-layout id='audioStudentShare' class=''>
		<div class="input">
			<yd-textarea  v-model.trim='inputVal' placeholder="写写学习感悟~" maxlength="150"></yd-textarea>
		</div>
		<div class="btn" @click="submit">提交</div>
	</yd-layout>
</template>

<script> 
	import {TextArea} from 'vue-ydui/dist/lib.rem/textarea';
	export default{
		components:{
			[TextArea.name]:TextArea,
		},
		data(){
			return {
				inputVal:''
			}
		},
		created() {
		},
		watch: {
			
		},
		computed: {
			
		},
		mounted(){
			document.title='学员感悟'
		},
		methods:{
			submit(){
				if(this.inputVal){
					this.$root.ajax({
						name: 'comment/doComment',
						params: {
							kind: this.$route.query.kind||0,
							oid:this.$route.query.oid,
							content:this.inputVal,
						}
					}).then((d) => {
						this.$dialog.toast({
		                    mes: '评论成功',
		                    timeout: 1500,
		                    icon: 'success',
		                    callback: () => {
		                    	//这样写的好处是不用生成history
		                    	this.$router.go(-1)
		                    }
		                });
					})
				}else{
					this.$dialog.toast({
	                    mes: '请输入学习感悟~',
	                    timeout: 1500,
	                });
				}
				
				
			}
		}
	}
</script>

<style lang="scss">
	@import './audioStudentShare.scss';
</style>